﻿//全局函数
layui.use(['jquery', 'layer', 'util'], function () {
    var $ = layui.jquery,
        layer = layui.layer,
        util = layui.util;
    util.fixbar();
    //导航控制

    var active = {
        loginBtnClick:function() {
            var that = this;
            console.log(that);
            Common.open1("/ajax/login.do","用户登录");
        }
    };

    $('.layui-btn').on('click', function(){
        var othis = $(this), method = othis.data('method');
        active[method] ? active[method].call(this, othis) : '';
    });
});
master.start = function ($) {
    $('#nav li').hover(function () {
        $(this).addClass('current');
    }, function () {
        var href = $(this).find('a').attr("href");
        if (pathname.indexOf(href) == -1) {
            $(this).removeClass('current');
        }
    });
    selectSpaceNav();
    function selectSpaceNav() {
        var navobjs = $("#spaceNav a");
        $.each(navobjs, function () {
            var href = $(this).attr("href");
            if (pathname == href) {
                $(this).parent().addClass('current');
            }
        });
    };
};
